﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};
	
	var resulttypeData = Jxstar.findComboData('resulttype');
	var auditData = Jxstar.findComboData('audit');
	var items = [{
		height: '97%',
		width: '97%',
		border: false,
		layout: 'form',
		style: 'padding:10px;',
		items: [{
			anchor:'100%',
			border: false,
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textfield', fieldLabel:'质量检查编号', name:'quality_check__plan_no', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'datefield', fieldLabel:'计划检测日期', name:'quality_check__plan_date', format:'Y-m-d', anchor:'100%', readOnly:true},
					{xtype:'textfield', fieldLabel:'项目名称', name:'quality_check__project_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'textfield', fieldLabel:'项目负责人', name:'quality_check__project_user', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'任务名称', name:'quality_check__task_name', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'重要性', name:'quality_check__importance', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'检查等级', name:'quality_check__check_level', readOnly:true, anchor:'100%', maxLength:10},
					{xtype:'datefield', fieldLabel:'记录日期', name:'quality_check__record_date', format:'Y-m-d', anchor:'100%', readOnly:true},
					{xtype:'textfield', fieldLabel:'记录人', name:'quality_check__record_user', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'combo', fieldLabel:'检测结果', name:'quality_check__record_result',
						anchor:'100%', editable:false, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*',
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: resulttypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: resulttypeData[0][0]},
					{xtype:'textfield', fieldLabel:'整改编号', name:'quality_check__quest_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'hidden', fieldLabel:'检查类型', name:'quality_check__check_type1', defaultval:'0', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'部门ID', name:'quality_check__dept_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目ID', name:'quality_check__project_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'记录人ID', name:'quality_check__record_userid', anchor:'100%'}
				]
			},{
				border:false,
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'combo', fieldLabel:'记录状态', name:'quality_check__auditing1', defaultval:'0',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: auditData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: auditData[0][0]},
					{xtype:'textfield', fieldLabel:'检测人', name:'quality_check__check_user', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'项目编号', name:'quality_check__project_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'实施部门', name:'quality_check__dept_name', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'numberfield', allowDecimals:false, fieldLabel:'任务序号', name:'quality_check__task_no', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'textfield', fieldLabel:'检查类别', name:'quality_check__check_type', readOnly:true, anchor:'100%', maxLength:10},
					{xtype:'textfield', fieldLabel:'权重', name:'quality_check__weight', readOnly:true, anchor:'100%', maxLength:10},
					{xtype:'textfield', fieldLabel:'检查工期', name:'quality_check__check_period', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'datefield', fieldLabel:'最早开工日期', name:'quality_check__start_date', format:'Y-m-d', anchor:'100%', readOnly:true},
					{xtype:'datefield', fieldLabel:'最早结束日期', name:'quality_check__end_date', format:'Y-m-d', anchor:'100%', readOnly:true},
					{xtype:'hidden', fieldLabel:'主键', name:'quality_check__check_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目负责人ID', name:'quality_check__project_userid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'检测人id', name:'quality_check__check_userid', anchor:'100%'}
				]
			}
			]
		},{
			anchor:'100%',
			border: false,
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				columnWidth:0.99,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textarea', fieldLabel:'检测内容', name:'quality_check__check_content', readOnly:true, width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'检测结果说明', name:'quality_check__record_memo', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'备注', name:'quality_check__comments', width:'100%', height:48, maxLength:200}
				]
			}
			]
		}]
	}];
	
	config.param = {
		items: items,
		funid: 'quality_checkreg'
	};

	config.eventcfg = {					addQuest: function(){			var keyid = this.getPkField().getValue();			if (keyid == null || keyid.length == 0) {				JxHint.alert(jx.event.nosave);	//当前记录没有保存，不能操作！				return;			}						var self = this;			//取选择记录的主键值			var params = 'funid='+ self.define.nodeid;			params += '&keyid=' + keyid;			//设置请求的参数			params += '&pagetype=form&eventcode=addQuest';			//执行处理的内容			var endcall = function(data) {				//重新加载数据				//self.grid.getStore().reload();			};			//发送请求			Request.postRequest(params, endcall);		}	};
	
	return new Jxstar.FormNode(config);
}